﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Collections;
using SchoolProject2012.Langue;

namespace SchoolProject2012.Domain
{
    [MetadataType(typeof(ClasseCV))]
    public class Classe
    {
        public int id { get; set; }
        public string libelle { get; set; }
        public string annee { get; set; }
        public List<Eleve> lstEleve { get; set; }

        #region controle de validite
        public class ClasseCV
        {
            public int id { get; set; }
            [StringLength(50), Required]
            public string libelle { get; set; }
            [StringLength(50), Required]
            [RegularExpression(@"^[0-9]*$", ErrorMessageResourceType = typeof(Resources), ErrorMessageResourceName = "ErrorMessageMail")]
            public string annee { get; set; }

            public ClasseCV() { }

            public ClasseCV(Classe classe)
            {
                id = classe.id;
                libelle = classe.libelle;
                annee = classe.annee;
            }
        }
        #endregion
    }
}